<?php
if(!defined('IN_XLR')) {
	exit('Access Denied');
}

//上传照片
function api_moment_detail($apiReq){
	global $_SGLOBAL, $_CONFIG;
 
    if(!isset($apiReq["id"])){
	     $apiOut["returncode"] = "2000";
	     return $apiOut;
	}

	$momentid = $apiReq["id"];
	$sql = "select a.*,b.thumb,b.height,b.sex from moment a,member b where a.member_id=b.id and a.id='$momentid'";
 	$moment = get_db()->get_row($sql);
 	if(!$moment){
         $apiOut["returncode"] = "2001";
	     return $apiOut;
 	}

  	$sql = "select a.*,b.nickname,b.thumb from moment_reply a,member b where a.member_id=b.id and a.moment_id='$momentid'";
	$replys = get_db()->get_results($sql);
 
	//输出
	$apiOut["returncode"] = "0";
	$apiOut["moment"] = $moment;
	$apiOut["replys"] = $replys;
  
	return $apiOut;
}
